#include <iostream>
#include <vector>
#include <string>
using namespace std;
class Solution
{
public:
    vector<int> goodDaysToRobBank(vector<int> &security, int time)
    {
        vector<int> ans{};
        vector<int> left(security.size(), 0);
        vector<int> right(security.size(), 0);
        if (time == 0)
        {
            for (int i = 0; i < security.size(); i++)
                ans.push_back(i);
            return ans;
        }
        if (security.size() < time * 2 + 1)
            return ans;
        int t = 0, index = 0;
        for (int i = 1; i < security.size(); i++)
        {
            if (security[i - 1] >= security[i])
                left[i] = left[i - 1] + 1;
        }
        for (int i = security.size() - 2; i >= 0; i--)
        {
            if (security[i] <= security[i + 1])
                right[i] = right[i + 1] + 1;
        }
        for (int i = 0; i < security.size(); i++)
        {
            if (left[i] >= time && right[i] >= time)
                ans.push_back(i);
        }
        return ans;
    }
};
int main()
{
    Solution *s = new Solution();
    vector<int> ans;
    vector<int> security{5, 3, 3, 3, 5, 6, 2};
    ans = s->goodDaysToRobBank(security, 2);
    for (int i = 0; i < ans.size(); i++)
        cout << ans[i] << endl;
    return 0;
}